<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:replace="dashboard/header :: header"></head>
<body class="gray-bg">

<!--
@desc  管理
@author WeiXiaoJin
@since 2019-10-05 13:52:49
-->

	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="operlog-form">
					<div class="select-list">
						<ul>
						<li><label> 作业名称 </label><input type="text" name="condition[jobName|like]"/></li>
						<li><label> 任务名称,每次作业运行生成新任务 </label><input type="text" name="condition[taskId|like]"/></li>
						<li><label> 主机名称 </label><input type="text" name="condition[hostname|like]"/></li>
						<li><label> 主机IP </label><input type="text" name="condition[ip|like]"/></li>
						<li><label> 分片项 </label><input type="text" name="condition[shardingItem|like]"/></li>
						<li><label> 作业执行来源 </label><input type="text" name="condition[executionSource|like]"/></li>
						<li><label> 执行失败原因 </label><input type="text" name="condition[failureCause|like]"/></li>
						<li><label> 是否执行成功 </label><input type="text" name="condition[isSuccess|like]"/></li>
						<li class="select-time"><label> 作业开始执行时间 </label>
							<input type="text" class="time-input" placeholder="开始时间" name="condition[startTime|like]" lay-key="1">
							<span>-</span>
							<input type="text" class="time-input" placeholder="结束时间" name="condition[startTime|like]" lay-key="2">
						</li>
						<li class="select-time"><label> 作业结束执行时间 </label>
							<input type="text" class="time-input" placeholder="开始时间" name="condition[completeTime|like]" lay-key="1">
							<span>-</span>
							<input type="text" class="time-input" placeholder="结束时间" name="condition[completeTime|like]" lay-key="2">
						</li>
						<li>
							<a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
						</li>
						</ul>
					</div>
				</form>
			</div>

			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()">
	                <i class="fa fa-plus"></i> 新增
	            </a>
	            <a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()">
		            <i class="fa fa-edit"></i> 修改
		        </a>
				<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()">
		            <i class="fa fa-remove"></i> 删除
		        </a>
		        <a class="btn btn-danger" onclick="$.operate.clean()">
	                <i class="fa fa-trash"></i> 清空
	            </a>
	            <a class="btn btn-warning" onclick="$.table.exportExcel()">
		            <i class="fa fa-download"></i> 导出
		        </a>
	        </div>

			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>

	<footer th:replace="dashboard/footer :: footer"></footer>

	<script>
		var prefix = ctx + "business/boot/executionLog/" ;

		$(function() {
		    var options = {
		        url: prefix +"datatables" ,
		        createUrl: prefix + 'add' ,
		        updateUrl: prefix +"modify?id={id}" ,
		        changeStatusUrl: prefix +"changeStatus?id={id}" ,
		        cleanUrl: prefix + "clean",
		        detailUrl: prefix +"detail?id={id}",
		        removeUrl: prefix + "delete" ,
		        exportUrl: prefix + "export",
		        sortName: "operTime",
		        uniqueId:"id" ,
		        sortOrder: "desc",
                modalName: "",
		        escape: true,
		        showPageGo: true,
		        rememberSelected: true,
		        columns: [{field: 'state',checkbox: true },

		{field: 'jobName', title: '作业名称'},
					{field: 'taskId', title: '任务名称,每次作业运行生成新任务'},
					{field: 'hostname', title: '主机名称'},
					{field: 'ip', title: '主机IP'},
					{field: 'shardingItem', title: '分片项'},
					{field: 'executionSource', title: '作业执行来源'},
					{field: 'failureCause', title: '执行失败原因'},
					{field: 'isSuccess', title: '是否执行成功'},
					{field: 'startTime', title: '作业开始执行时间'},
					{field: 'completeTime', title: '作业结束执行时间'},
					    {field: 'hasStatusLabel', title: '状态', align: 'center',  formatter:function(value,row,index){ return $.table.status(value , row);}},
			        {field: 'addTime', title: '添加时间', sortable: true},
			        {field: 'id' , title: '操作',  align: 'center',  formatter: function(value, row, index) {
			                var actions = [];

			                actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
			                actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
			                actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');

			                return actions.join('');
			          }
			     }]
		    };
		    $.table.init(options);
		});

	</script>
</body>
</html>

